<template>
  <div>ret: {{ ret }}</div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
const ret = ref()
const p = new Promise((resolve, reject) => {
  reject('在构造函数中reject')
})
  .then(
    out => {
      console.log('out的值是', out)
      ret.value = out
    },
    e => {
      ret.value = `then的reject回调捕获: ${e}`
    }
  )
  .catch(e => {
    ret.value = `promise的catch捕获:${e}`
  })
</script>

<style scoped></style>
